const {Email} = require('../../regist')
const path = require('path')


class EmailService {

	constructor(user,pass){
		this.user = user;
		this.email = new Email(user,pass)
	}

	orderSuccess(data){
		return this.email.sendHtml(this.user,"下单成功",path.join(__dirname,'assert','orderSuccess.html'),data)
	}

	error(msg){
		return this.email.sendMsg(this.user,"下单错误",msg)
	}

}


module.exports = {EmailService}